

export const handlerData = (data) => {
    console.log('data', data);
    return {
        title: {
            text: "顾客消费次数分布",
            x: "center",
            y: "8%",
            textStyle: {
                color: '#000',
                fontSize: '18'
            },
            subtextStyle: {
                color: '#90979c',
    
            },
        },
        tooltip: {
            trigger: 'item',
            formatter: "{a} <br/>{b} : {c} ({d}%)"
        },
        color: ['#8fc31f', '#f35833', '#00ccff',],
        legend: {
            show: false,
            orient: 'vertical',
            x: 'right',
            data: ['套餐A', '套餐B', '套餐C',],
            // formatter: function (name) {
            //     var oa = option.series[0].data;
            //     var num = oa[0].value + oa[1].value + oa[2].value + oa[3].value;
            //     for (var i = 0; i < option.series[0].data.length; i++) {
            //         if (name == oa[i].name) {
            //             return name + '     ' + oa[i].value + '     ' + (oa[i].value / num * 100).toFixed(2) + '%';
            //         }
            //     }
            // }
        },
        series: [
            {
                name: '顾客消费次数分布',
                type: 'pie',
                radius: '55%',
                center: ['50%', '55%'],
                data: [
                    { value: 335, name: '套餐A' },
                    { value: 310, name: '套餐B' },
                    { value: 234, name: '套餐C' },
                ],
                itemStyle: {
                    emphasis: {
                        shadowBlur: 10,
                        shadowOffsetX: 0,
                        shadowColor: 'rgba(0, 0, 0, 0.5)'
                    }
                },
                itemStyle: {
                    normal: {
                        label: {
                            show: true,
                            //	                            position:'inside',
                            formatter: '{b}'
                        }
                    },
                    labelLine: { show: false }
                }
            }
        ]
    };


}


